#include <iostream>
using namespace std;

void hanoi(int n, char a, char b, char c)
{
    if (n == 1)
    {
        cout << n << " : " << a << "    to    " << c << endl;
    }
    else
    {
        hanoi(n - 1, a, c, b);
        cout << n << " : " << a << "    to    " << c << endl;
        hanoi(n - 1, b, a, c);
    }
}

int main()
{
    hanoi(8, 'a', 'b', 'c');
}

// Python. After all ,it's 2019 now.
// def hanoi(n, a, b, c):
//     if n == 1:
//         print(a, '-->', c)
//     else:
//         hanoi(n - 1, a, c, b)
//         print(a, '-->', c)
//         hanoi(n - 1, b, a, c)
//
// hanoi(5, 'A', 'B', 'C')